// pages/memorandum/history/history.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		pg: 1,
		pd: 1,
	},

	/**
	 * 生命周期函数--监听页面加载
	 */
	// action=getMyBaoYang，uid=用户ID，pg=当前页码
	onLoad: function(options) {
		console.log(options.id)
		this.setData({
			id:options.id
		})
		this.push()
	},
	push(){
		wx.request({
			url: getApp().globalData.http + 'action=getMyBaoYang&uid=' + this.data.id + '&pg=' + this.data.pg,
			success: (e) => {
				console.log(e)
				let pd=1
				if(e.data.data.length<15){
					this.setData({
						pd:0
					})
				}
				this.setData({
					pd:pd,
					data:e.data.data
				})
			}
		})
	},
	ovo() {
		if (this.data.pd == 'false') {
			let a = this.data.pg + 1
			this.setData({
				pg: a
			})
			this.push()
		}
	},
})
